package com.shanzhe.eshop.order.controller;

import com.shanzhe.eshop.common.constant.UrlConstant;
import com.shanzhe.eshop.common.util.ResultBean;
import com.shanzhe.eshop.order.pojo.OrderDTO;
import com.shanzhe.eshop.order.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author yinwei
 * @create 2021/9/30
 * @Version 1.0
 */
@RestController
@RequestMapping(value = UrlConstant.ORDER_URL)
@Api(tags = "订单维护")
public class OrderController {

    @Autowired
    OrderService orderService;


    /**
     * 获取订单列表
     * @param orderId
     * @return
     */
    @GetMapping("/listOrders/{orderId}")
    @ApiOperation("获取订单列表")
    ResultBean<OrderDTO> listOrders(@PathVariable("orderId") Long orderId){
         return orderService.listOrders(orderId);
    }
}
